-- GENERATED SPELL FOR [Icewing Marshal] --


function spell0_14764(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(22911,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14764', 2342, 1)
end

function spell1_14764(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14764', 562, 1)
end

function spell2_14764(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(23511,pUnit)
pUnit:RegisterEvent('Sorts_14764', 30266, 1)
end

function spell3_14764(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_14764', 515, 1)
end

function spell4_14764(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_14764', 577, 1)
end

function spell5_14764(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(13736,pUnit)
pUnit:RegisterEvent('Sorts_14764', 2000, 1)
end

function Sorts_14764(pUnit, Event)
local choix_sorts_14764 = math.random(0, 5)
if choix_sorts_14764 == 0 then
pUnit:RegisterEvent('spell0_14764', 1, 1)
end
if choix_sorts_14764 == 1 then
pUnit:RegisterEvent('spell1_14764', 1, 1)
end
if choix_sorts_14764 == 2 then
pUnit:RegisterEvent('spell2_14764', 1, 1)
end
if choix_sorts_14764 == 3 then
pUnit:RegisterEvent('spell3_14764', 1, 1)
end
if choix_sorts_14764 == 4 then
pUnit:RegisterEvent('spell4_14764', 1, 1)
end
if choix_sorts_14764 == 5 then
pUnit:RegisterEvent('spell5_14764', 1, 1)
end
end

function mob14764_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14764', math.random(1500, 3000), 1)
end

function mob14764_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14764_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14764_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14764, 1, 'mob14764_Action')
RegisterUnitEvent(14764, 2, 'mob14764_Leave')
RegisterUnitEvent(14764, 3, 'mob14764_Kill')
RegisterUnitEvent(14764, 4, 'mob14764_Die')
